package net.yihang.miaosha.controller.result;

public class CodeMsg {
    private int code;
    private String msg;

    public static CodeMsg LOGIN_SUCCESS = new CodeMsg(0, "登录成功");
    public static CodeMsg INTERNAL_ERROR = new CodeMsg(500100, "服务器内部错误");

    // 秒杀用户错误
    public static CodeMsg MOBILE_EMPTY = new CodeMsg(500201, "手机不能为空");
    public static CodeMsg MOBILE_NOTEXIST = new CodeMsg(500202, "手机不存在");
    public static CodeMsg PASSWORD_EMPTY = new CodeMsg(500203, "密码不能为空");
    public static CodeMsg PASSWORD_ERROR = new CodeMsg(500204, "密码错误");

    // 校验失败
    public static final String MOBILE_PATTERN_ERROR_MSG = "手机号码格式不对";
    public static final CodeMsg MOBILE_PATTERN_ERROR = new CodeMsg(500205,MOBILE_PATTERN_ERROR_MSG);

    // 库存不足
    public static CodeMsg STOCK_EMPTY = new CodeMsg(500300, "库存不足");
    public static CodeMsg QIANG_ERROR = new CodeMsg(500302, "非法抢购");

    public static CodeMsg MIAOSHA_SUCCESS = new CodeMsg(500301, "秒杀成功");

    private CodeMsg(int code, String msg) {
        super();
        this.code = code;
        this.msg = msg;
    }

    public int getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }

}
